﻿using System.Collections.Generic;
using System.Linq;
using MovieAPI.Models;
namespace MovieAPI.DAL
{
    public class ActorInfoDAL
    {
        
        /// <summary>
        /// 通过电影ID获取主演信息
        /// </summary>
        /// <param name="movieID"></param>
        /// <returns></returns>
        public static List<ActorInfo> GetActInfoByMID(int movieID)
        {
            using (filmEntities db = new filmEntities())
            {
                return db.ActorInfo.Where(A => A.MoiveID == movieID).ToList();
            }

        }
        /// <summary>
        /// 通过演员信息ID获取演员
        /// </summary>
        /// <param name="ActInfoID"></param>
        /// <returns></returns>
        public static List<Actor> GetActByActInfoID(int ActInfoID)
        {
            using (filmEntities db = new filmEntities())
            {
                return db.Actor.Where(A => A.ActorID == ActInfoID).ToList();
            }

        }
    }
}